home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / gnu / recode.lha / recode-3.2.4 / cccaebcd.c < prev    next >
C/C++ Source or Header  |  1992-08-19  |  3KB  |  68 lines

  1. /* Conversion of files between different charsets and usages.
  2.    Copyright (C) 1990 Free Software Foundation, Inc.
  3.    Francois Pinard <pinard@iro.umontreal.ca>, 1988.
  4.  
  5.    This program is free software; you can redistribute it and/or modify
  6.    it under the terms of the GNU General Public License as published by
  7.    the Free Software Foundation; either version 2, or (at your option)
  8.    any later version.
  9.  
  10.    This program is distributed in the hope that it will be useful, but
  11.    WITHOUT ANY WARRANTY; without even the implied warranty of
  12.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.    General Public License for more details.
  14.  
  15.    You should have received a copy of the GNU General Public License
  16.    along with this program; if not, write to the Free Software
  17.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. */
  19.  
  20. #define STEP    cccascii_ebcdic
  21. #include <stdio.h>
  22. #include "common.h"
  23.  
  24. static unsigned char translation_table[256] = 
  25.   {
  26.      '\000', '\001', '\002', '\003', '\067', '\055', '\056', '\057',
  27.      '\026', '\005', '\045', '\013', '\014', '\015', '\016', '\017',
  28.      '\020', '\021', '\022', '\023', '\074', '\075', '\062', '\046',
  29.      '\030', '\031', '\077', '\047', '\034', '\035', '\036', '\037',
  30.      '\100', '\132', '\177', '\173', '\133', '\154', '\120', '\175',
  31.      '\115', '\135', '\134', '\116', '\153', '\140', '\113', '\141',
  32.      '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
  33.      '\370', '\371', '\172', '\136', '\114', '\176', '\156', '\157',
  34.      '\174', '\301', '\302', '\303', '\304', '\305', '\306', '\307',
  35.      '\310', '\311', '\321', '\322', '\323', '\324', '\325', '\326',
  36.      '\327', '\330', '\331', '\342', '\343', '\344', '\345', '\346',
  37.      '\347', '\350', '\351', '\112', '\340', '\117', '\137', '\155',
  38.      '\171', '\201', '\202', '\203', '\204', '\205', '\206', '\207',
  39.      '\210', '\211', '\221', '\222', '\223', '\224', '\225', '\226',
  40.      '\227', '\230', '\231', '\242', '\243', '\244', '\245', '\246',
  41.      '\247', '\250', '\251', '\300', '\152', '\320', '\241', '\007',
  42.      '\004', '\006', '\010', '\011', '\012', '\024', '\025', '\027',
  43.      '\032', '\033', '\212', '\213', '\214', '\215', '\216', '\217',
  44.      '\040', '\041', '\042', '\043', '\044', '\050', '\051', '\052',
  45.      '\053', '\054', '\232', '\233', '\234', '\235', '\236', '\237',
  46.      '\060', '\061', '\063', '\064', '\065', '\066', '\070', '\071',
  47.      '\072', '\073', '\252', '\253', '\254', '\255', '\256', '\257',
  48.      '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267',
  49.      '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277',
  50.      '\200', '\101', '\102', '\103', '\104', '\105', '\106', '\107',
  51.      '\110', '\111', '\312', '\313', '\314', '\315', '\316', '\317',
  52.      '\220', '\121', '\122', '\123', '\124', '\125', '\126', '\127',
  53.      '\130', '\131', '\332', '\333', '\334', '\335', '\336', '\337',
  54.      '\240', '\341', '\142', '\143', '\144', '\145', '\146', '\147',
  55.      '\150', '\151', '\352', '\353', '\354', '\355', '\356', '\357',
  56.      '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167',
  57.      '\170', '\076', '\372', '\373', '\374', '\375', '\376', '\377',
  58. };
  59.  
  60. void
  61. STEP (FILE *input_file, FILE *output_file)
  62. {
  63.   int input_char;        /* current character */
  64.  
  65.   while (input_char = getc (input_file), input_char != EOF)
  66.     putc (translation_table[input_char], output_file);
  67. }
  68.